<%-- 
    Document   : searchsupplier
    Created on : Jun 13, 2011, 9:27:26 AM
    Author     : A7med Kotb
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Search For Page</title>
        <script>
            var xmlhttp;    
            function change(){
                var param = document.getElementById("parameter").value;
                var level=document.getElementById("level").value;
                
                  if (window.XMLHttpRequest)
                {// code for IE7+, Firefox, Chrome, Opera, Safari
                    xmlhttp=new XMLHttpRequest();
                }
                else
                {// code for IE6, IE5
                    xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
                }
            xmlhttp.onreadystatechange=handlechange;
            xmlhttp.open("GET","AjaxSearch.do?param=" + param +"&level="+level,true);
            xmlhttp.send();
            }
         function handlechange()
            {
                
                if(xmlhttp.readyState==4){
                    var divresult=document.getElementById("data");
                   divresult.innerHTML=xmlhttp.responseText;
                }
                
            }
        </script>
    </head>
    <body>
        <h2>Welcome to Search Page</h2>
         <select id="parameter">
                            <option value="0">Select Parameter</option>
                            <option value="width_by">Width</option>
                            <option value="length_by">Length</option>
                            <option value="weight_by">Weight</option>
                            <option value="pages_by">Pages</option>
                            <option value="depth_by">Depth</option>
                            <option value="format_by">Format</option>
                            <option value="mailformat_by">Mail_Format</option>
                            <option value="item_by">Item</option>
                            <option value="prodcode_by">ProdCode</option>
         </select>
         <select id="level" onchange="change();">
                            <option value="0">Select Accuracy Level</option>
                            <option value="1">1</option>
                            <option value="2">2</option>
                            <option value="3">3</option>
                            <option value="4">4</option>
                            <option value="5">5</option>
                            <option value="6">6</option>
                            <option value="7">7</option>
                            <option value="8">8</option>
                            <option value="9">9</option>
                            <option value="10">10</option>
         </select>
            <div id="data"></div>
    </body>
</html>
